//
//  SCRenTableViewCell.m
//  XRSquare
//
//  Created by 穆相臣 on 2018/8/21.
//  Copyright © 2018年 UaenaMo. All rights reserved.
//

#import "SCRenTableViewCell.h"

@interface SCRenTableViewCell ()
{
    UIImageView * avatar;
    UILabel * name;
    NSDictionary * currentData;
}
@end

@implementation SCRenTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        avatar = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 50, 50)];
        avatar.layer.cornerRadius = 25;
        avatar.clipsToBounds = YES;
        [self addSubview:avatar];
        
        name = [[UILabel alloc]initWithFrame:CGRectMake(70, 10, ScreenWidth, 50)];
        name.font = [UIFont boldSystemFontOfSize:15];
        [self addSubview:name];
        
        
        UIView * line = [[UIView alloc]initWithFrame:CGRectMake(0, 69, ScreenWidth, 1)];
        line.backgroundColor = [UIColor colorFromHexCode:@"f3f3f3"];
        [self addSubview:line];
        
    }
    return self;
}

+(CGFloat)height
{
    return 70;
}

-(void)loadData:(NSDictionary *)data
{
    currentData = data;
    [avatar sd_setImageWithURL:[NSURL URLWithString:[data objectForKey:@"PicURL"]]];
    name.text = [data objectForKey:@"NickName"];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
